<div class="enter_price">
<?php
	$strColor	= urldecode($this->arrParam['color_id']);
	$arrDataColor = @json_decode($strColor, true);
	
	$value = urldecode($this->arrParam['value']);
	$arrValue = @json_decode($value, true);
	
	$arrColor = $this->slbColor;
	$arrSize = $this->slbSize;
	
	$linkPost	= $this->cmsUrl(array(
			'module' => 'admin',
			'controller' => 'admin-products',
			'action' => 'enter-stock',
			'color_id' => $this->arrParam['color_id']
	));
?>
	<h1>Choose enter quantity for each color: <span id="item-name"></span></h1>
	<form name="frm-enter-stock" id="frm-enter-stock" method="post" action="<?php echo $linkPost?>">
	<?php 
	if(!empty($arrDataColor)){
		foreach ($arrDataColor as $k => $v){
			$sizeName = Zendvn_Filter_Filter::filterContent($arrSize[$k], 'filter');
	?>
		<div class="lev">
			<label>Size <?php echo $sizeName?></label>
			<div class="stock_quantity" style="overflow: hidden;">
			<?php 
			foreach ($arrDataColor[$k] as $ke => $va){
				$colorName = Zendvn_Filter_Filter::filterContent($arrColor[$va], 'filter');
				$stock = $arrValue[$k][$va];
				$stock	= $this->formText('stock[' . $k . '][' . $va . ']', $stock, array('placeholder' => 'Quantity'));
			?>
				<div class="frm_input">
					<span>Color <?php echo $colorName?></span>
					<?php echo $stock?>
					<p class="frm_error"></p>
				</div>
			<?php }?>
			</div>
			<div class="clr"></div>
		</div>
	<?php 
		}
	}
	?>
		
		<div class="lev">
			<label></label>
			<a href="#" class="btn-save">Save</a>
		</div>
	</form>
</div>
	
<script>
	$(document).ready(function(){
		$('.btn-save').click(function(){
			var options = { 
					dataType: "json", 
					success	: optionsEnt
				}; 
			$('#frm-enter-stock').ajaxSubmit(options);
			return false;
		});
	})
	function optionsEnt(data){
		$('.frm_error').html('').hide();
		if(data.type == 'success'){
			$('#hidden_stock').val(data.msg);
			$.fancybox.close();
		}
	}
</script>
	